package com.example.devinfan.criminalintent.model;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.Serializable;

/**
 * Created by devinfan on 2/23/15.
 */
public class Photo implements Serializable {
    private static final String JSON_FILENAME = "filename";
    private String mFilename;
    /**
     * Create a Photo repersenting an existing file on disk
     */

    public Photo(){
        mFilename = null;
    }

    public Photo(String filename){
        mFilename = filename;
    }

    public Photo(JSONObject json) throws JSONException{
        mFilename = json.getString(JSON_FILENAME);
    }

    public JSONObject toJSON() throws JSONException{
        JSONObject json = new JSONObject();
        json.put(JSON_FILENAME,mFilename);
        return json;
    }

    public String getFilename(){
        return mFilename;
    }
}
